<template>
	<fs-page class="PageFeatureSearchMulti">
		<fs-crud ref="crudRef" v-bind="crudBinding">
			<template #cell_url="scope">
				<el-tag size="small">{{ scope.row.url }}</el-tag>
			</template>
			<template #actionbar-left>								
				<el-dropdown @command="crudBinding.method.handleCommand" v-if="auth('CaseInfoModelViewSet:ExportAndImport')">
					<el-button type="primary">						
						<el-icon class="el-icon--left"><arrow-down /></el-icon>Excel导入导出
					</el-button>
					<template #dropdown>
						<el-dropdown-menu>
							<el-dropdown-item command="a">导出案件列表Excel</el-dropdown-item>
							<el-dropdown-item command="b">导入案件列表Excel</el-dropdown-item>
							<el-dropdown-item command="c">导入法院Excel（按分组）</el-dropdown-item>
							<el-dropdown-item command="d">导入法院Excel（按案件）</el-dropdown-item>												
						</el-dropdown-menu>
					</template>
				</el-dropdown>
				<el-button type="primary" style="margin-left: 10px;" v-if="auth('CaseInfoModelViewSet:BatchMark')">批量标记</el-button>
				<el-button type="primary" v-if="auth('CaseInfoModelViewSet:BatchEdit')" @click="crudBinding.method.batchModify">批量修改</el-button>
				<el-button type="primary" v-if="auth('CaseInfoModelViewSet:BatchGroup')" @click="crudBinding.method.batchGroup">批量分组</el-button>
				<el-dropdown @command="crudBinding.method.handleCommand" style="margin-left: 10px;" v-if="auth('CaseInfoModelViewSet:ExportInitDoc')">
					<el-button type="primary">
						<el-icon class="el-icon--left"><arrow-down /></el-icon>导出初始文书
					</el-button>
					<template #dropdown>
						<el-dropdown-menu>
							<el-dropdown-item command="e">起诉状</el-dropdown-item>
							<el-dropdown-item command="f">余额构成表</el-dropdown-item>
							<el-dropdown-item command="g">授权委托书</el-dropdown-item>
							<el-dropdown-item command="h">保全担保书</el-dropdown-item>
							<el-dropdown-item command="e">保全申请书</el-dropdown-item>
							<el-dropdown-item command="f">网络查控书</el-dropdown-item>
							<el-dropdown-item command="g">保全担保书（线下冻结）</el-dropdown-item>
							<el-dropdown-item command="h">保全申请书（线下冻结）</el-dropdown-item>
							<el-dropdown-item command="i">所函</el-dropdown-item>
						</el-dropdown-menu>
					</template>
				</el-dropdown>
				<el-dropdown @command="crudBinding.method.handleCommand" style="margin-left: 10px;" v-if="auth('CaseInfoModelViewSet:ExportEvidence')">
					<el-button type="primary">
						<el-icon class="el-icon--left"><arrow-down /></el-icon>导出证据资料
					</el-button>
					<template #dropdown>
						<el-dropdown-menu>
							<el-dropdown-item command="j">原始资料</el-dropdown-item>
							<el-dropdown-item command="k">合并影像件</el-dropdown-item>							
						</el-dropdown-menu>
					</template>
				</el-dropdown>
				<el-dropdown @command="crudBinding.method.handleCommand" style="margin-left: 10px;" v-if="auth('CaseInfoModelViewSet:ExportFlowDoc')">
					<el-button type="primary">
						<el-icon class="el-icon--left"><arrow-down /></el-icon>导出流程文书
					</el-button>
					<template #dropdown>
						<el-dropdown-menu>
							<el-dropdown-item command="l">保全裁定书</el-dropdown-item>
							<el-dropdown-item command="m">解封裁定书【记录型】</el-dropdown-item>
							<el-dropdown-item command="n">解封裁定书【事后型】</el-dropdown-item>
							<el-dropdown-item command="o">保全裁定书【线下】</el-dropdown-item>
							<el-dropdown-item command="p">协助执行通知书【线下】</el-dropdown-item>
							<el-dropdown-item command="q">解封裁定书【线下】</el-dropdown-item>							
						</el-dropdown-menu>
					</template>
				</el-dropdown>
				<div v-if="auth('CaseInfoModelViewSet:ExportOther')">
					<el-dropdown @command="crudBinding.method.handleCommand"  style="margin-left: 10px;">
						<el-button type="primary">
							<el-icon class="el-icon--left"><arrow-down /></el-icon>导出其它
						</el-button>
						<template #dropdown>
							<el-dropdown-menu>
								<el-dropdown-item command="r">导出线下冻结电话</el-dropdown-item>
								<el-dropdown-item command="s">导出不保全撤诉案件</el-dropdown-item>							
							</el-dropdown-menu>
						</template>
					</el-dropdown>
				</div>				
			</template>
		</fs-crud>
	</fs-page>
</template>

<script lang="ts">
import { ref, onMounted, defineComponent} from 'vue';

import { useFs } from '@fast-crud/fast-crud';
import {auth} from '/@/utils/authFunction';
import createCrudOptions  from './crud';



export default defineComponent({    //这里配置defineComponent
    name: "CaseInfoModelViewSet",   //把name放在这里进行配置了
    setup() {   //这里配置了setup()

		const { crudBinding, crudRef, crudExpose, resetCrudOptions } = useFs({ createCrudOptions});  

		
		// 页面打开后获取列表数据
		onMounted(() => {
			crudExpose.doRefresh();
		});
		return {  
		//增加了return把需要给上面<template>内调用的<fs-crud ref="crudRef" v-bind="crudBinding">
				crudBinding,
				crudRef,
				auth,				
			};
    } 	//这里关闭setup()
  });  //关闭defineComponent

</script>
<style lang="scss" >
	.el-form-item--default {
		.el-form-item__label,.el-form-item--default {
			width: 130px !important;
		}
	}	 
</style>